package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.JiajiaMailOrderDetailMapper;
import com.ruoyi.system.domain.JiajiaMailOrderDetail;
import com.ruoyi.system.service.IJiajiaMailOrderDetailService;
import com.ruoyi.common.core.text.Convert;

/**
 * 商城订单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-05
 */
@Service
public class JiajiaMailOrderDetailServiceImpl implements IJiajiaMailOrderDetailService 
{
    @Autowired
    private JiajiaMailOrderDetailMapper jiajiaMailOrderDetailMapper;

    /**
     * 查询商城订单明细
     * 
     * @param id 商城订单明细主键
     * @return 商城订单明细
     */
    @Override
    public JiajiaMailOrderDetail selectJiajiaMailOrderDetailById(Long id)
    {
        return jiajiaMailOrderDetailMapper.selectJiajiaMailOrderDetailById(id);
    }

    /**
     * 查询商城订单明细列表
     * 
     * @param jiajiaMailOrderDetail 商城订单明细
     * @return 商城订单明细
     */
    @Override
    public List<JiajiaMailOrderDetail> selectJiajiaMailOrderDetailList(JiajiaMailOrderDetail jiajiaMailOrderDetail)
    {
        return jiajiaMailOrderDetailMapper.selectJiajiaMailOrderDetailList(jiajiaMailOrderDetail);
    }

    /**
     * 新增商城订单明细
     * 
     * @param jiajiaMailOrderDetail 商城订单明细
     * @return 结果
     */
    @Override
    public int insertJiajiaMailOrderDetail(JiajiaMailOrderDetail jiajiaMailOrderDetail)
    {
        jiajiaMailOrderDetail.setCreateTime(DateUtils.getNowDate());
        return jiajiaMailOrderDetailMapper.insertJiajiaMailOrderDetail(jiajiaMailOrderDetail);
    }

    /**
     * 修改商城订单明细
     * 
     * @param jiajiaMailOrderDetail 商城订单明细
     * @return 结果
     */
    @Override
    public int updateJiajiaMailOrderDetail(JiajiaMailOrderDetail jiajiaMailOrderDetail)
    {
        jiajiaMailOrderDetail.setUpdateTime(DateUtils.getNowDate());
        return jiajiaMailOrderDetailMapper.updateJiajiaMailOrderDetail(jiajiaMailOrderDetail);
    }

    /**
     * 批量删除商城订单明细
     * 
     * @param ids 需要删除的商城订单明细主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaMailOrderDetailByIds(String ids)
    {
        return jiajiaMailOrderDetailMapper.deleteJiajiaMailOrderDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商城订单明细信息
     * 
     * @param id 商城订单明细主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaMailOrderDetailById(Long id)
    {
        return jiajiaMailOrderDetailMapper.deleteJiajiaMailOrderDetailById(id);
    }
}
